import 'package:get/get.dart';
import 'package:getxsample/bindings/login_binding.dart';
import '../controller/home_controller.dart';
import '../middleware/auth_middleware.dart';
import '../pages/login_page.dart';

import '../pages/first_page.dart';
import '../pages/follower_list_page.dart';
import '../pages/home_page.dart';
import '../pages/second_page.dart';
import '../pages/third_page.dart';
import '../pages/unknown_page.dart';
import '../pages/user_profile_page.dart';

class Routes {
  static const HOME = '/home';
  static const FIRST = '/first';
  static const SECOND = '/second';
  static const THIRD = '/third';
  static const PROFILE = "/profile";
  static const FOLLOW_LIST = "/follower_list";
  static const LOGIN = "/login";
  static const UNKNOWN = "/unknown";

  static var unkonwn_page = GetPage(name: UNKNOWN, page: () => const UnknownPage());

  static final routes = [
    unkonwn_page,
    GetPage(
      name: HOME,
      page: () => const HomePage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<HomeController>(() => HomeController());
      }),
      middlewares: [AuthMiddleware()],
    ),
    GetPage(name: FIRST, page: () => const FirstPage()),
    GetPage(name: SECOND, page: () => const SecondPage(), transition: Transition.circularReveal),
    GetPage(name: THIRD, page: () => const ThirdPage()),
    GetPage(name: PROFILE, page: () => const UserProfilePage(), transition: Transition.cupertino),
    GetPage(name: FOLLOW_LIST, page: () => const FollowerListPage(), transition: Transition.fadeIn),
    GetPage(name: LOGIN, page: () => const LoginPage(), bindings: [LoginBinding()]),
  ];
}
